package com.example.shinelonx6.myapplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;


public class MainActivity extends Activity {
    private TextView name;
    private TextView password;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        name=(TextView)findViewById(R.id.youruser);
        password=(TextView)findViewById(R.id.yourpassword);
    }
    public void Clk_register(View v){
        Intent intent = new Intent(this,register.class);
        startActivityForResult(intent, 1);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(requestCode == 1){
            if(requestCode == 1){
                String strname = data.getStringExtra("name");
                String strpassword = data.getStringExtra("password");
                name.setText(strname);
                password.setText(strpassword);
            }
        }
    }
}
